package com.zhiyou100.interface_demo2;

public class Test {

    public static void main(String[] args) {

        Mouse mouse = new Mouse();
        mouse.function();

        Keyboard keyboard = new Keyboard();
        keyboard.function();
        //多态  向上转型
        USB usb = new Mouse();
        usb.function();
        USB usb2 = new Keyboard();
        usb2.function();

        System.out.println("------------------------");
        Computer computer = new Computer();
        computer.setName("华为");
        computer.startUp();
        computer.useUSB(usb);

    }

}
